#!/bin/bash
source ../common/common.sh

fix_chinese_env()
{
  sudo locale-gen zh_CN.utf8
  sudo sh -c "echo 'LANG=\"zh_CN.UTF-8\"' > /etc/default/locale"
  sudo sh -c "echo 'LANGUAGE=\"zh_CN.UTF-8:zh_CN:zh\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_NUMERIC=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_TIME=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_MONETARY=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_PAPER=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_NAME=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_ADDRESS=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_TELEPHONE=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_MEASUREMENT=\"zh_CN.UTF-8\"' >> /etc/default/locale"
  sudo sh -c "echo 'LC_IDENTIFICATION=\"zh_CN.UTF-8\"' >> /etc/default/locale"
}

chk_mkdir ~/.config

echo "===INIT==UBUNTU=TOOLS=BASELIB==="
sudo echo "SUDO ROOT"

show t "安装terminator等终端工具"
install_apt_pack "force|terminator"

show t "安装vim等文字处理工具"
install_apt_pack "force|vim dos2unix html2text"

show t "安装zip,unzip等压缩解压缩工具"
install_apt_pack "force|zip unzip"

show t "安装python开发和pip安装支持"
install_apt_pack "force|python-dev python-pip scons"
install_pip_pack progressbar
install_pip_pack progressbar2

show t "安装git hg svn版本管理客户端"
install_apt_pack "force|git mercurial subversion"

show t "安装gcc开发基本库"
install_apt_pack "force|build-essential autogen libtool automake"

show t "安装cmake开发基本库"
install_apt_pack "force|cmake cmake-data cmake-doc cmake-dbg"
if [ `is_desktop` -eq 1 ]; then  
  install_apt_pack "force|cmake-curses-gui cmake-qt-gui"
fi

show t "安装openssh"
install_apt_pack "force|openssh-server openssh-client"

show t "安装aptitude"
#sudo apt-get install -y aptitude
#aptitude install lib32stdc++6 libstdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1
install_apt_pack "force|aptitude"

show t "安装npm"
install_apt_pack "force|npm"

show t "安装curl"
install_apt_pack "force|curl libcurl4-openssl-dev"

show t "安装crudini"
install_apt_pack "force|crudini"

fix_chinese_env

# sudo sed -i "GSSAPIAuthentication yes"
# sudo sed -i "GSSAPIDeleagteCredentials no"
# sudo echo "UseDNS no" > /etc/ssh/sshd_config
